/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.srcptit.javatrainning.hieptq.btvn1;

import java.util.Scanner;

/**
 *
 * @author Hiep
 */
public class Bai4 {
    public static void main(String[] args){
	Scanner sc=new Scanner(System.in);
	System.out.print("Nhap n: ");
	int n=sc.nextInt();
	for(int i=2;i<n;i++){
		int dem=0;
		for(int j=2;j<i;j++)
			if(i%j==0)
				dem++;
		if(dem==0)
			System.out.print(" "+i);
	}

}

}
